﻿using Authentication.Configuration;
using Authentication.Model.Model;
using Common.Data.Extensions;
using System.Data.Entity.ModelConfiguration;

namespace Authentication.Data.DBConfig
{
    public class AccountLogonAuditConfiguration : DBConfig<AccountLogonAudit>
    {
        public AccountLogonAuditConfiguration()
            : base(SystemConfiguration.Schema, SystemConfiguration.NamingType, SystemConfiguration.TABLE_PREFIX)
        {
            HasKey(x => new { x.ApplicationKey, x.Id });
            Property(c => c.ClientIpAddress).IsRequired().HasMaxLength(15);
            Property(c => c.ClientMachineName).HasMaxLength(128);
            Property(c => c.ClientUserName).HasMaxLength(20);
            Property(c => c.CreationDate);
            Property(c => c.UserName).HasMaxLength(20);
            Property(c => c.FullnameEnglish).HasMaxLength(128);
            Property(c => c.Id);
        }
    }
}
